Index: framework/common/config/CommonUiLabels_it.properties =================================================================== --- framework/common/config/CommonUiLabels_it.properties (revision 474917) +++ framework/common/config/CommonUiLabels_it.properties (working copy) @@ -161,6 +161,8 @@ CommonFormatDateFieldNotCorrect=Uno dei campi data non \u00e8 corretto, il formato deve essere AAAA-mm-jj HH:mm:ss CommonFormatDateTime=YYYY-MM-DD hh:mm:ss CommonFound=Trovato +CommonFrameAlert1=Avviso Frame +CommonFrameAlert2=Questo documento \u00e8 deisegnato per essere visualizzato usando i frames. Se vedi questo messaggio, tu stai usando un client web senza capacit\u00e0 frame. CommonFriday=Venerd\u00ec CommonFrom=Da CommonFromAddress=Dall'Indirizzo Index: framework/common/config/CommonUiLabels.properties =================================================================== --- framework/common/config/CommonUiLabels.properties (revision 474917) +++ framework/common/config/CommonUiLabels.properties (working copy) @@ -163,6 +163,8 @@ CommonFormatDateFieldNotCorrect=One of the date field is incorrect, format must be AAAA-mm-jj HH:mm:ss CommonFormatDateTime=YYYY-MM-DD hh:mm:ss CommonFound=Found +CommonFrameAlert1=Frame Alert +CommonFrameAlert2=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. CommonFriday=Friday CommonFrom=From CommonFromAddress=From Address Index: framework/webtools/widget/EntityScreens.xml =================================================================== --- framework/webtools/widget/EntityScreens.xml (revision 474983) +++ framework/webtools/widget/EntityScreens.xml (working copy) @@ -217,5 +217,107 @@ + +
+ + + + + + + +

${uiLabelMap.WebtoolsRemoveAllTables}

+
+ + ${uiLabelMap.WebtoolsGroupName}: + + +
+

${uiLabelMap.WebtoolsCreateRemoveAllPrimaryKeys}

+
+ + ${uiLabelMap.WebtoolsGroupName}: + +
+
+ + ${uiLabelMap.WebtoolsGroupName}: + +
+

${uiLabelMap.WebtoolsCreateRemoveAllDeclaredIndices}

+
+ + ${uiLabelMap.WebtoolsGroupName}: + +
+
+ + ${uiLabelMap.WebtoolsGroupName}: + +

${uiLabelMap.WebtoolsCreateRemoveAllForeignKeyIndices}

+ + + ${uiLabelMap.WebtoolsGroupName}: + +
+
+ + ${uiLabelMap.WebtoolsGroupName}: + +
+

${uiLabelMap.WebtoolsCreateRemoveAllForeignKeys}

+

${uiLabelMap.WebtoolsNote3}

+
+ + ${uiLabelMap.WebtoolsGroupName}: + +
+
+ + ${uiLabelMap.WebtoolsGroupName}: + +
+

${uiLabelMap.WebtoolsUpdateCharacterSetAndCollate}

+
+ + ${uiLabelMap.WebtoolsGroupName}: + +
+
+ +<#if miters?has_content> +
    + <#list miters as miter> + ${miter} + +
+ \ No newline at end of file Index: framework/webtools/webapp/webtools/entity/entityref_main.jsp =================================================================== --- framework/webtools/webapp/webtools/entity/entityref_main.jsp (revision 474917) +++ framework/webtools/webapp/webtools/entity/entityref_main.jsp (working copy) @@ -1,202 +0,0 @@ -<%-- -Copyright 2001-2006 The Apache Software Foundation - -Licensed under the Apache License, Version 2.0 (the "License"); you may not -use this file except in compliance with the License. You may obtain a copy of -the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -License for the specific language governing permissions and limitations -under the License. ---%> - -<%@ page import="java.util.*" %> -<%@ page import="org.ofbiz.entity.*, org.ofbiz.entity.model.*, org.ofbiz.base.util.*" %> - - - -<%String controlPath=(String)request.getAttribute("_CONTROL_PATH_");%> - -<% -if(security.hasPermission("ENTITY_MAINT", session)) { - boolean forstatic = "true".equals(request.getParameter("forstatic")); - String search = null; - //GenericDelegator delegator = GenericHelperFactory.getDefaultHelper(); - ModelReader reader = delegator.getModelReader(); - Map packages = new HashMap(); - TreeSet packageNames = new TreeSet(); - TreeSet tableNames = new TreeSet(); - - //put the entityNames TreeSets in a HashMap by packageName - Collection ec = reader.getEntityNames(); - TreeSet entityNames = new TreeSet(ec); - Iterator ecIter = ec.iterator(); - while(ecIter.hasNext()) { - String eName = (String)ecIter.next(); - ModelEntity ent = reader.getModelEntity(eName); - - //make sure the table name is in the list of all table names, if not null - if (UtilValidate.isNotEmpty(ent.getPlainTableName())) tableNames.add(ent.getPlainTableName()); - - TreeSet entities = (TreeSet)packages.get(ent.getPackageName()); - if(entities == null) { - entities = new TreeSet(); - packages.put(ent.getPackageName(), entities); - packageNames.add(ent.getPackageName()); - } - entities.add(eName); - } - int numberOfEntities = ec.size(); - int numberShowed = 0; - search = (String) request.getParameter("search"); -%> - - - -Entity Reference - - - - - -
- -
Entity Reference Chart
- <%=numberOfEntities%> Total Entities -
-<% - Iterator piter = packageNames.iterator(); - while (piter.hasNext()) { - String pName = (String) piter.next(); - TreeSet entities = (TreeSet) packages.get(pName); -%>
<%=pName%>

<% - Iterator i = entities.iterator(); - while (i.hasNext()) { - String entityName = (String)i.next(); - String helperName = delegator.getEntityHelperName(entityName); - String groupName = delegator.getEntityGroupName(entityName); - if (search == null || entityName.toLowerCase().indexOf(search.toLowerCase()) != -1) { - ModelEntity entity = reader.getModelEntity(entityName); -%> - - - - - - - - - - - - - -<% - TreeSet ufields = new TreeSet(); - for (int y = 0; y < entity.getFieldsSize(); y++) { - ModelField field = entity.getField(y); - ModelFieldType type = delegator.getEntityFieldType(entity, field.getType()); - String javaName = null; - javaName = field.getIsPk() ? "" + field.getName() + "" : field.getName(); -%> - - - - - <%if(type != null){%> - - - <%}else{%> - - - <%}%> - -<% - } - if (entity.getRelationsSize() > 0) { -%> - - - - - - - - -<% - TreeSet relations = new TreeSet(); - for (int r = 0; r < entity.getRelationsSize(); r++) { - ModelRelation relation = entity.getRelation(r); -%> - - - - -<% - } - } -%> - - - -
-
ENTITY: <%=entityName%> | TABLE: <%=entity.getPlainTableName()%>
-
<%=entity.getTitle()%>  - <%if (!forstatic) {%>">[view data]<%}%>
- <%if (entity.getDescription() != null && !entity.getDescription().equalsIgnoreCase("NONE") && !entity.getDescription().equalsIgnoreCase("")) {%> -
<%=entity.getDescription()%>
- <%}%> -
Java NameDB NameField-TypeJava-TypeSQL-Type
<%=javaName%>
<%=field.getColName()%>
<%=field.getType()%>
<%=type.getJavaType()%>
<%=type.getSqlType()%>
NOT FOUND
NOT FOUND

RelationType
-
- <%=relation.getTitle()%><%=relation.getRelEntityName()%> -
- <%if (relation.getFkName().length() > 0) {%>
fk-name: <%=relation.getFkName()%>
<%}%> -
- <%=relation.getType()%>:<%if(relation.getType().length()==3){%> <%}%> - <%for (int km = 0; km < relation.getKeyMapsSize(); km++){ ModelKeyMap keyMap = relation.getKeyMap(km);%> -
  <%=km+1%>)  - <%if(keyMap.getFieldName().equals(keyMap.getRelFieldName())){%><%=keyMap.getFieldName()%> - <%}else{%><%=keyMap.getFieldName()%> : <%=keyMap.getRelFieldName()%><%}%> - <%}%> -
 
-
-<% - numberShowed++; - } - } - } -%> -

-

Displayed: <%= numberShowed %>

-
- - - -<%}else{%> - - - Entity Editor - - - -

Entity Editor

- -ERROR: You do not have permission to use this page (ENTITY_MAINT needed) - - - -<%}%> Index: framework/webtools/webapp/webtools/entity/checkdb.jsp =================================================================== --- framework/webtools/webapp/webtools/entity/checkdb.jsp (revision 474917) +++ framework/webtools/webapp/webtools/entity/checkdb.jsp (working copy) @@ -1,229 +0,0 @@ -<%@page contentType="text/html"%> -<%-- -Copyright 2001-2006 The Apache Software Foundation - -Licensed under the Apache License, Version 2.0 (the "License"); you may not -use this file except in compliance with the License. You may obtain a copy of -the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -License for the specific language governing permissions and limitations -under the License. ---%> - -<%@ page import="java.util.*" %> -<%@ page import="org.ofbiz.base.util.*" %> -<%@ page import="org.ofbiz.entity.*, org.ofbiz.entity.util.*, org.ofbiz.entity.datasource.*" %> -<%@ page import="org.ofbiz.entity.model.*, org.ofbiz.entity.jdbc.*" %> - - - -<%String controlPath=(String)request.getAttribute("_CONTROL_PATH_");%> - -<% -if(security.hasPermission("ENTITY_MAINT", session)) { - boolean addMissing = "true".equals(request.getParameter("addMissing")); - boolean checkFkIdx = "true".equals(request.getParameter("checkFkIdx")); - boolean checkFks = "true".equals(request.getParameter("checkFks")); - boolean checkPks = "true".equals(request.getParameter("checkPks")); - boolean repair = "true".equals(request.getParameter("repair")); - String option = request.getParameter("option"); - String groupName = request.getParameter("groupName"); - - Iterator miter = null; - if(groupName != null && groupName.length() > 0) { - String helperName = delegator.getGroupHelperName(groupName); - - List messages = new LinkedList(); - //GenericHelper helper = GenericHelperFactory.getHelper(helperName); - DatabaseUtil dbUtil = new DatabaseUtil(helperName); - Map modelEntities = delegator.getModelEntityMapByGroup(groupName); - Set modelEntityNames = new TreeSet(modelEntities.keySet()); - - if ("checkupdatetables".equals(option)) { - List fieldsToRepair = null; - if (repair) { - fieldsToRepair = new ArrayList(); - } - dbUtil.checkDb(modelEntities, fieldsToRepair, messages, checkPks, checkFks, checkFkIdx, addMissing); - if (fieldsToRepair != null && fieldsToRepair.size() > 0) { - dbUtil.repairColumnSizeChanges(modelEntities, fieldsToRepair, messages); - } - } else if ("removetables".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.deleteTable(modelEntity, messages); - } - } else if ("removepks".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.deletePrimaryKey(modelEntity, messages); - } - } else if ("createpks".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.createPrimaryKey(modelEntity, messages); - } - } else if ("createfkidxs".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.createForeignKeyIndices(modelEntity, messages); - } - } else if ("removefkidxs".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.deleteForeignKeyIndices(modelEntity, messages); - } - } else if ("createfks".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.createForeignKeys(modelEntity, modelEntities, messages); - } - } else if ("removefks".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.deleteForeignKeys(modelEntity, modelEntities, messages); - } - } else if ("createidx".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.createDeclaredIndices(modelEntity, messages); - } - } else if ("removeidx".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.deleteDeclaredIndices(modelEntity, messages); - } - } else if ("updateCharsetCollate".equals(option)) { - Iterator modelEntityNameIter = modelEntityNames.iterator(); - while (modelEntityNameIter.hasNext()) { - String modelEntityName = (String) modelEntityNameIter.next(); - ModelEntity modelEntity = (ModelEntity) modelEntities.get(modelEntityName); - dbUtil.updateCharacterSetAndCollation(modelEntity, messages); - } - } - miter = messages.iterator(); - } -%> - -

Check/Update Database

- -
"> - - Group Name: " size="40"/> -   pks -   fks -   fk-idx -   Add Missing -   Repair Column Sizes - -
- -

NOTE: Use the following at your own risk; make sure you know what you are doing before running these...

- - - - -

Remove All Tables

-
" name="TablesRemoveForm"> - - Group Name: " size="40"/> - - -
- -

Create/Remove All Primary Keys

-
"> - - Group Name: " size="40"/> - -
-
"> - - Group Name: " size="40"/> - -
- -

Create/Remove All Declared Indices

-
"> - - Group Name: " size="40"/> - -
-
"> - - Group Name: " size="40"/> - -
- -

Create/Remove All Foreign Key Indices

-
"> - - Group Name: " size="40"/> - -
-
"> - - Group Name: " size="40"/> - -
- -

Create/Remove All Foreign Keys

-

NOTE: Foreign keys may also be created in the Check/Update database operation if the check-fks-on-start and other options on the datasource element are setup to do so.

-
"> - - Group Name: " size="40"/> - -
-
"> - - Group Name: " size="40"/> - -
- -

Update character-set and collate (based on settings on datasource in entityengine.xml)

-
"> - - Group Name: " size="40"/> - -
- -
-
    -<%while (miter != null && miter.hasNext()) {%> - <%String message = (String) miter.next();%> -
  • <%=message%>
  • -<%}%> -
-<%} else {%> -

Entity Editor

-
ERROR: You do not have permission to use this page (ENTITY_MAINT needed)
-<%}%>